/**
 * 
 */
package optimization.naturalOptimization.evolutionaryAlgorithm.evolutionaryOperator;

import optimization.naturalOptimization.evolutionaryAlgorithm.EvolutionaryAlgorithm;

/**
 * 
 * @author Kevin Wagner
 * @version 1.0
 *            Type of search space
 */
public abstract class EvolutionaryOperator {

	private EvolutionaryAlgorithm parentEA;

	/**
	 * @param parentEA
	 *            the evolutionary algorithm which uses this operator
	 */
	public EvolutionaryOperator(EvolutionaryAlgorithm parentEA) {
		this.setParentEA(parentEA);
	}

	/**
	 * Performs the evolutionary operator.
	 */
	public abstract void work();

	/**
	 * Sets the parent evolutionary Algorithm which uses this operator.
	 * 
	 * @param parentEA
	 *            new parent evolutionary Algorithm
	 */
	public void setParentEA(EvolutionaryAlgorithm parentEA) {
		this.parentEA = parentEA;
	}

	/**
	 * Returns the parent evolutionary Algorithm which uses this operator.
	 * 
	 * @return the parent evolutionary Algorithm
	 */
	public EvolutionaryAlgorithm getParentEA() {
		return parentEA;
	}
}
